package com.coolwen.service;

import com.coolwen.dao.UserRoleMapper;
import com.coolwen.entity.UserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by user on 2016/7/4.
 */
@Service("userRole")
public class UserRoleServiceImpl implements UserRoleService {


    @Autowired
    private UserRoleMapper urDao;
    @Override
    public int add(UserRole userRole) {
        return urDao.insertSelective(userRole);
    }

    @Override
    public int delete(Integer id) {
        return urDao.deleteByPrimaryKey(id);
    }

    @Override
    public int update(UserRole userRole) {
        return urDao.updateById(userRole);
    }

    @Override
    public UserRole load(Integer id) {
        return urDao.selectById(id);
    }
}
